[mirrors]
ftp://invisible-island.net/xterm/xterm-324.tgz

[vars]
filesize=1235312
sha512=f6f2518a11eec6e41afb10ca4ec298c566b1fc5c3b3c4c4d533311b3f64ec04c2bc692798e75bbd34382cb64eca9b21ee4b05438c4d18486046d3c710c586626

[deps]
libx11
libxaw
libxft
curses

[build]
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/')"
# Gleiches mit gleichem vergelten.
CFLAGS="-include termcap.h -g -D__GNU__ -D__GLIBC__=2 -D__GLIBC_MINOR__=10 -D_POSIX_SOURCE -D_GNU_SOURCE $optcflags" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
  ./configure -C \
  --prefix="$butch_prefix" \
  --mandir=/share/man \
  --enable-256-color \
  --enable-wide-chars \
  --disable-tek4014 \
  --disable-active-icon \
  --disable-builtin-xpms \
  --without-xpm \
  ac_cv_header_lastlog_h=no cf_cv_path_lastlog=no $xconfflags
cat <<EOF >>ptyx.h
#ifndef HACKY_HACKY_GETPT
#define HACKY_HACKY_GETPT
static inline int getpt() { return open("/dev/ptmx",O_RDWR|O_NOCTTY); }
#endif
EOF
touch curses.h
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install
dest="$butch_install_dir""$butch_prefix"
mkdir -p "$dest"/share/applications/
cp -f xterm.desktop "$dest"/share/applications/
# replace the ugly 70ies xterm icon with a nice one
sed -i 's@xterm-color_48x48@terminal@' "$dest"/share/applications/xterm.desktop
